<style>
    #expert-user {
        padding: 25px 25px 25px 25px;
    }
</style>
<div class="layui-fluid" id="expert-user">
    <form class="layui-form" action="" lay-filter="expert-user-form">
        <div class="layui-form-item website-hide">
            <label class="layui-form-label website-form-item-require">专家id：</label>
            <div class="layui-input-block">
                <input type="text" name="expertId" data-th-value="${expertId}">
            </div>
        </div>
        <div class="layui-col-xs12 layui-col-lg4 layui-col-lg-offset4">
            <div class="layui-form" lay-filter="register-form">
                <div class="layui-anim layui-anim-upbit">
                    <!--<ul class="login-type-tab">
                        <li class="active">注册</li>
                    </ul>-->
                    <div class="normal-login-form">
                        <div class="layui-form-item">
                            <label class="layui-icon label-icon layui-icon-username"></label>
                            <input type="text" name="userName" lay-verify="required"
                                   placeholder="用户名" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-form-item password-block">
                            <label class="layui-icon label-icon layui-icon-password"></label>
                            <input type="password" name="password" lay-verify="required"
                                   placeholder="密码" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-form-item password-block">
                            <label class="layui-icon label-icon layui-icon-password"></label>
                            <input type="password" name="passwordB" lay-verify="required"
                                   placeholder="确认密码" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-form-item website-hide">
            <button class="layui-btn" lay-submit="" lay-filter="expert-user-form-submit" id="submit"></button>
        </div>
    </form>
</div>

<script data-th-inline="javascript">
    layui.use(['website', 'form','validate'], function () {
        var $ = layui.$,
            website = layui.website,
            layer = layui.layer,
            form = layui.form,
            $view = $('#expert-user'),
            validate = layui.validate;
        form.verify(validate);
        form.render();
        form.on('submit(expert-user-form-submit)', function (data) {
            var dateSoure = data.field
            if (dateSoure.password === dateSoure.passwordB) {
            website.post(ctx + 'expert/user', data.field, function () {
                layer.closeAll();
                website.alert.success('分配专家账号成功！');
                $('#website-expert').find('#query').click();
            });
            } else {
                website.alert.error('两次密码不一致！');
                return false
            }
            return false;
        });
    });
</script>